package academic.emailClient;

public enum CommunicationInstruction{
	SEND_MESSAGE(1),
	RECEIVE_MESSAGE(2),
	CREATE_MEETING(3),
	CANCEL_MEETING(4),
	REQUEST_UPDATE_MEETING(5),
	ACCEPT_MEETING(6),
	DECLINE_MEETING(7),
	RECEIVE_MEETING_DECLINATION(8),
	CONFIRM_MEETING_UPDATE(9),
	RESOLVE_MEETING_CONFLICTS(10),
	RECEIVE_MEETING_UPDATE(12);
	
	
	private Integer value;
	
	private CommunicationInstruction(int value) {
		this.value = new Integer(value);
	}
	
	public Integer value(){
		return value;
	}
	
	public static CommunicationInstruction convert(Integer value){
		 CommunicationInstruction[] instructions = values();		 
		 for (CommunicationInstruction instruction : instructions){
			 if (instruction.value.equals(value))
				 return instruction;
		 }
		 return null;
	}

};
